package com.pzsh.task;

import com.pzsh.service.ITaskService;
import com.pzsh.task.support.Task;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
@Slf4j
@Task(initialDelay = 1, period = 1440) //延迟 1 ，间隔 1440 分钟 ，单位自定义
public class RewardTask implements Runnable {

    @Autowired
    private ITaskService taskService;

    @Override
    public void run() {
        log.info("执行奖励 task:");
        taskService.RewardTask();
        log.info("执行奖励结束");
    }
}





